package net.tatu.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.tatu.dao.PubCodeMapper;
import net.tatu.dao.SysLogMapper;
import net.tatu.dao.UserMapper;
import net.tatu.model.PubCode;
import net.tatu.model.SysLog;
import net.tatu.model.User;
import net.tatu.service.PubCodeService;
import net.tatu.service.SysLogService;
import net.tatu.service.UserService;
import net.tatu.util.Encrypt;
import net.tatu.util.Util;

@Service
public class PubCodeServiceImpl implements PubCodeService {
	Logger log = Logger.getLogger(PubCodeServiceImpl.class);
	@Autowired
	private PubCodeMapper pubCodeMapper;

	@Override
	public String getPubCodeDesc(PubCode pubCode) {
		log.debug("get PubCode to database:" + pubCode.getCodeId());
		PubCode pc = pubCodeMapper.getPubCode(pubCode);
		log.debug("getPubCode success:" + pc.getCodeDesc());
		return pc.getCodeDesc();
	}

	@Override
	public List<PubCode> getCertTypes() {
		PubCode pubCode = new PubCode();
		pubCode.setCodeTypeCode(102);
		List<PubCode> certs = pubCodeMapper.getCerts(pubCode);
		return certs;
	}

	@Override
	public List<PubCode> getOrgBusinessYearsTypes() {
		PubCode pubCode = new PubCode();
		pubCode.setCodeTypeCode(109);
		List<PubCode> certs = pubCodeMapper.getCerts(pubCode);
		return certs;
	}

	@Override
	public List<PubCode> getDepthCodes() {
		PubCode pubCode = new PubCode();
		pubCode.setCodeTypeCode(119);
		List<PubCode> certs = pubCodeMapper.getCerts(pubCode);
		return certs;
	}

	@Override
	public List<PubCode> getComQualityCodes() {
		PubCode pubCode = new PubCode();
		pubCode.setCodeTypeCode(120);
		List<PubCode> certs = pubCodeMapper.getCerts(pubCode);
		return certs;
	}
}
